import {post,text} from '@/common/request';
import {requestParams, urlApiClientContent, urlPublicContent} from './ServerService';

const url = urlApiClientContent + 'personalCenter/';
const newUrl=urlApiClientContent+"appAccountRetrieve/"
const fileUrl=urlApiClientContent+"file/"
// 查询个人信息
export function getSysPerson() {
    return post(url +  requestParams('getSysPerson', {}), null,);
}
// 修改个人信息
export function updateSysPerson(obj) {
    return text(url +  requestParams('updateSysPerson', {}), obj,);
}
 
// 修改头像
export function updatePhoto({base64,fileName}) {
    return text(url +  requestParams('updatePhoto', {}), {data:base64,fileName},);
}
 
/**
 * 账号找回
 * @param sysPersonJson
 * @returns {Promise | Promise<unknown>}
 */
export function checkIdCardAndPhone(sysPersonJson) {
    return text(newUrl +  requestParams('checkIdCardAndPhone', {}), sysPersonJson,true);
}

// 手机号修改
export function updateBindPhone(oldPhone, phone ,verifyCode) {
    return post(url +  requestParams('updateBindPhone', {oldPhone, phone ,verifyCode}), null,);
}
 

export function newMobileLogin(payload) {
    return text(url +  requestParams('newMobileLogin', {}), payload,);
}
 
 
// 上传图片
export function uploadImg(payload) {
    return text(fileUrl +  requestParams('upload', {}), payload,);
}